package com.mc.thread;

/**
 * @author fumengchao
 * @ClassName ThreadTest.java
 * @Description TODO
 * @createTime 2021 0307 14:07:00
 */
public class ThreadTest {
    static Thread thread = null;
    static boolean flag = true;

    public static void test() {
        thread = new Thread() {
            @Override
            public void run() {
                while (flag) {
//                    System.out.println(1);

                }
            }
        };

        thread.start();
    }

    public static void main(String[] args) throws InterruptedException {
        test();
        Thread.sleep(100);
        flag=false;
    }

}